// 时间方法
export const dateOne = (e) => {
  let d = new Date(e);
  let year = d.getFullYear();
  let month = d.getMonth() + 1;
  let day = d.getDate();
  if (day < 10) day = "0" + day;
  if (month < 10) month = "0" + month;
  return year + "." + month + "." + day;
};

// html5利用getObjectURL获取图片路径上传图片
export const getObjectURL = (file) => {
  var url = null;
  if (window.createObjectURL != undefined) {
    // basic
    url = window.createObjectURL(file);
  } else if (window.URL != undefined) {
    // mozilla(firefox)
    url = window.URL.createObjectURL(file);
  } else if (window.webkitURL != undefined) {
    // webkit or chrome
    url = window.webkitURL.createObjectURL(file);
  }
  return url;
};
